import { useTable, LIST_TYPE } from '@crud/index';
import { getLecCosList } from '@/api/crm-agency/ad/lecturer';

// 查询
export const timeChange = (values:any[]) => {
  let from = undefined;
  let to = undefined;
  if (values && values.length > 0) {
    from = values[0];
    to = values[1];
  }
  return { from, to };
};
// 表格
export const useTableList = (options: any = {}) => {
  const columns: any = [
    { label: '账号名称', prop: 'nick_name', minWidth: 160 },
    { label: '手机号', prop: 'mobile', minWidth: 120 },
    { label: '续费时间', prop: 'complete_time', minWidth: 177, type: 'dateTime' },
    { label: '续费金额', prop: 'total_fee', minWidth: 160 },
    { label: '讲师佣金', prop: 'cos_fee', minWidth: 160 }
  ];

  return useTable({
    ...options,
    type: LIST_TYPE.AGENCY,
    params: {
      agent_id: undefined,
      keyword: undefined,
      to_dt: undefined,
      from_dt: undefined,
      _dateRange: []
    },
    columns: columns,
    getList: getLecCosList
  });
};
